/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoopp.qcoinpay;

import I;
import android.app.Activity;
import android.content.res.Resources;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.ScrollView;
import android.widget.TextView;
import com.qihoopp.framework.HttpLoaderCallback;
import com.qihoopp.framework.LogUtil;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONException;
import org.json.JSONObject;

final class au implements HttpLoaderCallback {
    public final void callback(int paramInt, JSONObject paramJSONObject) {
        if (paramInt == 6) {
            this.a.a(a.a(b.bk));
        }
        else if (paramInt == 2) {
            this.a.a(a.a(b.bj));
        }
        else if (paramInt == 3) {
            this.a.a(a.a(b.bl));
        }
        else if (paramInt == 5) {
            this.a.a(a.a(b.bi));
        }
        else if (paramInt == 4) {
            this.a.a(a.a(b.bh));
        }
        else if ((paramInt != -1) && (paramInt == 1)) {
            paramInt = null;
            Object localObject1 = new HashMap();
            Object localObject2 = null;
            Object localObject3 = null;
            Object localObject5;
            Object localObject6;
            if (paramJSONObject != null) {
                LogUtil.e("getOrderCallback", paramJSONObject.toString());
                try {
                    localObject2 = paramJSONObject.getString("result_code");
                    localObject3 = paramJSONObject.getString("result_msg");
                } catch (JSONException localJSONException1) {
                    LogUtil.e("QcoinActivity", "JSONException", localJSONException1);
                }
                if ((localObject2 != null) && ("0000".equals(localObject2)))
                    try {
                        paramInt = new u();
                        JSONObject localJSONObject = paramJSONObject.getJSONObject("record");
                        LogUtil.e("OrderModel", localJSONObject.toString());
                        paramJSONObject = localJSONObject.keys();
                        while (paramJSONObject.hasNext()) {
                            localObject2 = (String) paramJSONObject.next();
                            localObject5 = localJSONObject.getString((String) localObject2);
                            ((HashMap) localObject1).put(localObject2, localObject5);
                            localObject6 = localObject5;
                            localObject5 = localObject2;
                            localObject2 = paramInt;
                            if ("support_bank".equals(localObject5))
                                ((u) localObject2).a = ((String) localObject6);
                            if ("needLogin".equals(localObject5))
                                ((u) localObject2).b = ((String) localObject6);
                            if ("logged".equals(localObject5))
                                ((u) localObject2).c = ((String) localObject6);
                            if ("logName".equals(localObject5))
                                ((u) localObject2).d = ((String) localObject6);
                            if ("ts".equals(localObject5))
                                ((u) localObject2).e = ((String) localObject6);
                            if ("product_name".equals(localObject5))
                                ((u) localObject2).f = ((String) localObject6);
                            if ("rec_amount".equals(localObject5))
                                ((u) localObject2).g = ((String) localObject6);
                            if ("mer_display_name".equals(localObject5))
                                ((u) localObject2).h = ((String) localObject6);
                            if ("sign".equals(localObject5))
                                ((u) localObject2).i = ((String) localObject6);
                            if ("card_pay_type".equals(localObject5))
                                ((u) localObject2).l = ((String) localObject6);
                            if ("balance".equals(localObject5))
                                ((u) localObject2).j = ((String) localObject6);
                            if ("haspaypwd".equals(localObject5))
                                ((u) localObject2).k = ((String) localObject6);
                            if ("user_bindphone".equals(localObject5))
                                ((u) localObject2).m = ((String) localObject6);
                            if ("question_key".equals(localObject5))
                                ((u) localObject2).n = ((String) localObject6);
                            if ("question_desc".equals(localObject5))
                                ((u) localObject2).o = ((String) localObject6);
                        }
                        QcoinActivity.a(this.a, paramInt);
                    } catch (JSONException localJSONException2) {
                        paramInt = null;
                        LogUtil.e("QcoinActivity", "JSONException", localJSONException2);
                    }
            }
            if (paramInt == null) {
                Object localObject4 = a.a(b.t);
                if ((localObject3 != null) && (!("".equals(localObject3))))
                    localObject4 = localObject3;
                this.a.a((String) localObject4);
            }
            else if (!(QcoinActivity.a(this.a, (HashMap) localObject1))) {
                this.a.a(a.a(b.s));
            }
            else if (QcoinActivity.c(paramInt.a)) {
                localObject5 = paramInt;
                localObject2 = QcoinActivity.a(this.a);
                paramInt = (I) localObject5;
                localObject6 = null;
                localObject2.i.b.setText(paramInt.f);
                ((bc) localObject2).d.b = ((u) localObject5);
                localObject5 = "MOBILE_QCOIN";
                if (((localObject2 = QcoinActivity.a(this.a).d).f == null)
                        || (!(((aj) localObject2).f.equals(localObject5)))) {
                    ((aj) localObject2).f = ((String) localObject5);
                    ((aj) localObject2).c.removeAllViews();
                    localObject6 = new RelativeLayout.LayoutParams(-1, -1);
                    if (((String) localObject5).equals("MOBILE_QCOIN")) {
                        paramJSONObject = ((aj) localObject2).b;
                        if ((paramInt = ((aj) localObject2).g).k == null) {
                            paramInt.j = paramJSONObject;
                            paramInt.i = cz.a(paramInt.a, 3.0F);
                            paramJSONObject = cz.a(paramInt.a, 15.0F);
                            localObject1 = new ScrollView(paramInt.a);
                            (localObject3 = new RelativeLayout.LayoutParams(-1, -1)).setMargins(0,
                                    cz.a(paramInt.a, 10.0F), 0, 0);
                            paramInt.d.addView((View) localObject1, (ViewGroup.LayoutParams) localObject3);
                            localObject3 = new RelativeLayout(paramInt.a);
                            ((ScrollView) localObject1).addView((View) localObject3);
                            paramInt.k = new LinearLayout(paramInt.a);
                            paramInt.k.setOrientation(1);
                            paramInt.k.setPadding(paramJSONObject, 0, paramJSONObject, paramJSONObject);
                            paramJSONObject = new RelativeLayout.LayoutParams(-1, -2);
                            ((RelativeLayout) localObject3).addView(paramInt.k, paramJSONObject);
                            ((RelativeLayout) localObject3).addView(paramInt.g);
                            paramInt.a(paramInt.a.getResources().getConfiguration());
                            paramJSONObject = new LinearLayout.LayoutParams(-1, -2);
                            paramInt.k.addView(paramInt.e, paramJSONObject);
                            (paramJSONObject = new ImageView(paramInt.a)).setScaleType(ImageView.ScaleType.FIT_XY);
                            paramInt.c.a(paramJSONObject, "img_line.png");
                            paramInt.k.addView(paramJSONObject, new LinearLayout.LayoutParams(-1, -2));
                            (paramJSONObject = new LinearLayout(paramInt.a)).setOrientation(0);
                            (localObject1 = new TextView(paramInt.a)).setTextColor(-13421773);
                            ((TextView) localObject1).setTextSize(20.0F);
                            ((TextView) localObject1).setText(a.a(b.R));
                            paramJSONObject.addView((View) localObject1);
                            (localObject1 = new TextView(paramInt.a)).setSingleLine();
                            ((TextView) localObject1).setTextColor(-2555904);
                            ((TextView) localObject1).setTextSize(20.0F);
                            ((TextView) localObject1).setText(paramInt.j.g);
                            paramJSONObject.addView((View) localObject1);
                            (localObject1 = new TextView(paramInt.a)).setTextColor(-13421773);
                            ((TextView) localObject1).setTextSize(20.0F);
                            ((TextView) localObject1).setText(a.a(b.aa));
                            paramJSONObject.addView((View) localObject1);
                            (localObject1 = new LinearLayout.LayoutParams(paramInt.h, -2)).gravity = 1;
                            ((LinearLayout.LayoutParams) localObject1).topMargin = cz.a(paramInt.a, 12.0F);
                            paramInt.k.addView(paramJSONObject, (ViewGroup.LayoutParams) localObject1);
                            paramInt.l = new LinearLayout(paramInt.a);
                            (paramJSONObject = new LinearLayout.LayoutParams(-2, -2)).topMargin = cz.a(paramInt.a,
                                    12.0F);
                            paramJSONObject.gravity = 1;
                            paramInt.k.addView(paramInt.l, paramJSONObject);
                        }
                        if (((Float.parseFloat(((aj) localObject2).b.j) == 0.0F) ? 1 : 0) == 0)
                            if (!(((aj) localObject2).b.k.equals("Y")))
                                ((aj) localObject2).g.a(1);
                            else if (((aj) localObject2).a())
                                ((aj) localObject2).g.a(0);
                            else
                                ((aj) localObject2).g.a(2);
                        ((aj) localObject2).c.addView(((aj) localObject2).g.d, (ViewGroup.LayoutParams) localObject6);
                    }
                    if (((aj) localObject2).d == null) {
                        ((aj) localObject2).d = new TextView(((aj) localObject2).a);
                        ((aj) localObject2).d.setId(cz.a());
                        ((aj) localObject2).d.setSingleLine();
                        ((aj) localObject2).d.setTextColor(-13421773);
                        ((aj) localObject2).d.setTextSize(10.0F);
                        ((aj) localObject2).d.setText(a.a(b.b) + cx.a);
                        paramInt = cz.a(((aj) localObject2).a, 15.0F);
                        ((aj) localObject2).e = new RelativeLayout.LayoutParams(-2, -2);
                        ((aj) localObject2).e.addRule(12, -1);
                        ((aj) localObject2).e.addRule(11, -1);
                        ((aj) localObject2).e.rightMargin = paramInt;
                    }
                    ((aj) localObject2).c.addView(((aj) localObject2).d, ((aj) localObject2).e);
                }
            }
            else {
                this.a.a(a.a(b.av));
            }
        }
        QcoinActivity.a(this.a).c.setVisibility(8);
    }
}